import { axios } from '@/utils/request'

const api = {
  couponList: '/marketing/coupon-list',
  couponDel: '/marketing/coupon-del',
  couponAdd: '/marketing/coupon-add',
  couponEdit: '/marketing/coupon-edit',
  verifyList: '/marketing/verify-list',
  verifyDel: '/marketing/verify-del',
  verifyUp: '/marketing/verify-up',
  verifyUpload: '/marketing/verify-upload',
  verifyCardBatch: '/marketing/verify-card-batch',
  verifyAdd: '/marketing/verify-add',
  verifyEdit: '/marketing/verify-edit',
  verifySaleList: '/marketing/verify-sale-list',
  cardCouponList: '/marketing/card-coupon-list',
  cardCouponDel: '/marketing/card-coupon-del',
  cardCouponAdd: '/marketing/card-coupon-add',
  cardCouponEdit: '/marketing/card-coupon-edit',
  rechargeList: '/marketing/recharge-list',
  rechargeDel: '/marketing/recharge-del',
  rechargeAdd: '/marketing/recharge-add',
  rechargeEdit: '/marketing/recharge-edit',
  rechargeSetting: '/marketing/recharge-setting',
  rechargeOrder: '/marketing/recharge-order',
  couponAutoSendList: '/marketing/coupon-auto-send-list',
  couponAutoSendDel: '/marketing/coupon-auto-send-del',
  couponAutoSendAdd: '/marketing/coupon-auto-send-add',
  couponAutoSendEdit: '/marketing/coupon-auto-send-edit',
  couponSendUser: '/marketing/coupon-send-user',
  couponDels: 'marketing/coupon-batch',
  couponDetail: '/marketing/coupon-send-record',
  couponStatus: '/marketing/coupon-status',
  ruleList: '/marketing/coupon-auto-send-list',
  verifyDetail: '/marketing/verify-detail',
  getAccountInfo: '/marketing/get-account-info',
  couponQrcode: '/marketing/get-coupon-qrcode',
  createCard: 'marketing/make-card-info',
  exportCard: 'marketing/export',
  ruleStatus: 'marketing/rule-status',
  rechargeOrderRefundMoneyList: 'marketing/recharge-order-refund-money-list',
  rechargeOrderRefundMoneyAudit: 'marketing/recharge-order-refund-money-audit',
}

export default api

// 二维码
export function couponQrcode(parameter) {
  return axios({
    url: api.couponQrcode,
    method: 'get',
    params: parameter,
  })
}

// 优惠卷详情
export function couponDetail(parameter) {
  return axios({
    url: api.couponDetail,
    method: 'get',
    params: parameter,
  })
}

// 卡卷详情
export function verifyDetail(parameter) {
  return axios({
    url: api.verifyDetail,
    method: 'get',
    params: parameter,
  })
}

// 卡卷详情
export function getAccountInfo(params) {
  return axios({
    url: api.getAccountInfo,
    method: 'get',
    params,
  })
}

// 卡卷批量删除
export function verifyCardBatch(parameter) {
  return axios({
    url: api.verifyCardBatch,
    method: 'post',
    data: parameter,
  })
}
export function couponStatus(parameter) {
  return axios({
    url: api.couponStatus,
    method: 'post',
    data: parameter,
  })
}
export function couponSendUser(parameter) {
  return axios({
    url: api.couponSendUser,
    method: 'post',
    data: parameter,
  })
}

export function couponAutoSendList(parameter) {
  return axios({
    url: api.couponAutoSendList,
    method: 'get',
    params: parameter,
  })
}

export function couponAutoSendDel(parameter) {
  return axios({
    url: api.couponAutoSendDel,
    method: 'get',
    params: parameter,
  })
}

export function couponAutoSendAdd(parameter) {
  return axios({
    url: api.couponAutoSendAdd,
    method: 'post',
    data: parameter,
  })
}

export function couponAutoSendEdit(parameter) {
  return axios({
    url: api.couponAutoSendEdit,
    method: 'post',
    data: parameter,
  })
}

export function rechargeSetting(parameter) {
  return axios({
    url: api.rechargeSetting,
    method: 'post',
    data: parameter,
  })
}

export function rechargeOrder(parameter) {
  return axios({
    url: api.rechargeOrder,
    method: 'get',
    params: parameter,
  })
}

export function exprechargeOrder(parameter) {
  return axios({
    url: api.rechargeOrder,
    method: 'get',
    params: parameter,
    responseType: 'blob',
  })
}

export function rechargeList(parameter) {
  return axios({
    url: api.rechargeList,
    method: 'get',
    params: parameter,
  })
}

export function rechargeDel(parameter) {
  return axios({
    url: api.rechargeDel,
    method: 'get',
    params: parameter,
  })
}

export function rechargeAdd(parameter) {
  return axios({
    url: api.rechargeAdd,
    method: 'post',
    data: parameter,
  })
}

export function rechargeEdit(parameter) {
  return axios({
    url: api.rechargeEdit,
    method: 'post',
    data: parameter,
  })
}

export function cardCouponList(parameter) {
  return axios({
    url: api.cardCouponList,
    method: 'get',
    params: parameter,
  })
}

export function cardCouponDel(parameter) {
  return axios({
    url: api.cardCouponDel,
    method: 'get',
    params: parameter,
  })
}

export function cardCouponAdd(parameter) {
  return axios({
    url: api.cardCouponAdd,
    method: 'post',
    data: parameter,
  })
}

export function cardCouponEdit(parameter) {
  return axios({
    url: api.cardCouponEdit,
    method: 'post',
    data: parameter,
  })
}

export function verifySaleList(parameter) {
  return axios({
    url: api.verifySaleList,
    method: 'get',
    params: parameter,
  })
}

export function verifyList(parameter) {
  return axios({
    url: api.verifyList,
    method: 'get',
    params: parameter,
  })
}

export function verifyDel(parameter) {
  return axios({
    url: api.verifyDel,
    method: 'get',
    params: parameter,
  })
}

export function verifyAdd(parameter) {
  return axios({
    url: api.verifyAdd,
    method: 'post',
    data: parameter,
  })
}

export function verifyUp(parameter) {
  return axios({
    url: api.verifyUp,
    method: 'post',
    data: parameter,
  })
}

export function verifyUpload(parameter) {
  return axios({
    url: api.verifyUpload,
    method: 'post',
    data: parameter,
  })
}

export function verifyEdit(parameter) {
  return axios({
    url: api.verifyEdit,
    method: 'post',
    data: parameter,
  })
}
export function couponList(parameter) {
  return axios({
    url: api.couponList,
    method: 'get',
    params: parameter,
  })
}

export function couponDel(parameter) {
  return axios({
    url: api.couponDel,
    method: 'get',
    params: parameter,
  })
}

export function couponAdd(parameter) {
  return axios({
    url: api.couponAdd,
    method: 'post',
    data: parameter,
  })
}

export function couponEdit(parameter) {
  return axios({
    url: api.couponEdit,
    method: 'post',
    data: parameter,
  })
}
export function couponDels(parameter) {
  return axios({
    url: api.couponDels,
    method: 'post',
    data: parameter,
  })
}

export function getRuleCoupons(parameter) {
  return axios({
    url: '/marketing/coupon-list',
    method: 'get',
    data: parameter,
  })
}

export function addCouponRule(parameter) {
  return axios({
    url: '/marketing/coupon-auto-send-add',
    method: 'post',
    data: parameter,
  })
}

export function getRuleCouponList(parameter) {
  return axios({
    url: api.ruleList,
    method: 'get',
    params: parameter,
  })
}

export function deleteCouponRule(parameter) {
  return axios({
    url: '/marketing/coupon-auto-send-batch',
    method: 'post',
    data: parameter,
  })
}

export function dupdateCouponRule(parameter) {
  return axios({
    url: '/marketing/coupon-auto-send-edit',
    method: 'post',
    data: parameter,
  })
}

export function getCouponDetail(parameter) {
  return axios({
    url: api.couponDetail,
    method: 'get',
    params: parameter,
  })
}

export function createCard(parameter) {
  return axios({
    url: api.createCard,
    method: 'post',
    data: parameter,
  })
}
export function exportCard(parameter) {
  return axios({
    url: api.exportCard,
    method: 'post',
    data: parameter,
  })
}

export function ruleStatus(parameter) {
  return axios({
    url: api.ruleStatus,
    method: 'post',
    data: parameter,
  })
}

export function rechargeOrderRefundMoneyList(params) {
  return axios({
    url: api.rechargeOrderRefundMoneyList,
    method: 'get',
    params,
  })
}

export function rechargeOrderRefundMoneyAudit(data) {
  return axios({
    url: api.rechargeOrderRefundMoneyAudit,
    method: 'post',
    data,
  })
}
